

local mt = ac.skill['紧急治疗']
mt.art = [[ReplaceableTextures\CommandButtons\BTNPotionGreen.blp]]
mt.tip = [[
立刻恢复英雄30%生命(溢出恢复会转化为护盾5秒)
]]
mt.slotid = 3
mt.cool = 30

function mt:on_add()
    local hero = self.owner
    self:gc(hero:event '单位-即将受到治疗'(function(_,_,damage)
        if hero:get('生命')/hero:get('生命上限')<=0.3 then
            if self:check_cool() then
                self:cast_shot()
                self:start_cool()
                return 0
            end
        end
        return damage
    end))
end


function mt:on_cast_shot()
    local hero = self.owner
    local heal = hero:get('生命上限') * 0.3

    hero:heal(heal)
end


